<?php

/**
 * 根据用户权限菜单名称展示对应的icon
 * @author nbd
 * @since 2016-10-27
 */

namespace app\widgets;

use yii\base\Widget;

class IconWidget extends Widget
{
    public $powType = '';

    public function run()
    {
        switch ($this->powType) {
            case 'system':
                $iconHtml = '<i class="fa fa-wrench"></i>';
                break;
            case 'user':
                $iconHtml = '<i class="fa fa-users"></i>';
                break;
            default:
                $iconHtml = '<i class="fa fa-navicon"></i>';
        }
//        return Html::encode($iconHtml);
        return $iconHtml;
    }
}
